﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FSY.API.Utilities;
using FSY.Components.Entities;

namespace FSY.Web.Admin.Portals
{
    public partial class AddPortal : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.txtPortalName.Focus();
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            Fsy_Portal portal = new Fsy_Portal();
            portal.PortalName = this.txtPortalName.Text;
            portal.Discription = Server.HtmlEncode(this.txtDescription.Text);
            portal.CreatedOnDate = DateTime.Now;
            portal.CreatedByUserID = Fsy_Null.SetNullInteger(Session["UserID"].ToString());

            Fsy_PortalController.Insert(portal);

            this.txtPortalName.Text = string.Empty;
            this.txtDescription.Text = string.Empty;
        }
    }
}